home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / gcc263-src.lha / gcc-2.6.3 / config / m88k / dgux.h next >
C/C++ Source or Header  |  1994-08-12  |  9KB  |  247 lines

  1. /* Definitions of target machine for GNU compiler.
  2.    Motorola m88100 running DG/UX.
  3.    Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
  4.    Contributed by Michael Tiemann (tiemann@mcc.com)
  5.    Enhanced by Michael Meissner (meissner@osf.org)
  6.    Version 2 port by Tom Wood (twood@pets.sps.mot.com)
  7.    Currently maintained by (gcc@dg-rtp.dg.com)
  8.  
  9. This file is part of GNU CC.
  10.  
  11. GNU CC is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2, or (at your option)
  14. any later version.
  15.  
  16. GNU CC is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with GNU CC; see the file COPYING.  If not, write to
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. /* You're not seeing double!  To transition to dwarf debugging, both are
  26.    supported.  The option -msvr4 specifies elf.  With these combinations, 
  27.    -g means dwarf.  */
  28. /* DWARF_DEBUGGING_INFO defined in svr4.h.  */
  29. #define SDB_DEBUGGING_INFO
  30. #define PREFERRED_DEBUGGING_TYPE \
  31.   (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
  32.  
  33. #ifndef VERSION_INFO2
  34. #define VERSION_INFO2   "$Revision: 1.15 $"
  35. #endif
  36. #ifndef NO_BUGS
  37. #define AS_BUG_IMMEDIATE_LABEL
  38. /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'.  */
  39. #define AS_BUG_FLDCR
  40. #endif
  41.  
  42. #include "svr4.h"
  43. #include "m88k/m88k.h"
  44.  
  45. /* Augment TARGET_SWITCHES with the MXDB options.  */
  46. #define MASK_STANDARD        0x40000000 /* Retain standard information */
  47. #define MASK_LEGEND        0x20000000 /* Retain legend information */
  48. #define MASK_EXTERNAL_LEGEND    0x10000000 /* Make external legends */
  49.  
  50. #define TARGET_STANDARD          (target_flags & MASK_STANDARD)
  51. #define TARGET_LEGEND          (target_flags & MASK_LEGEND)
  52. #define TARGET_EXTERNAL_LEGEND      (target_flags & MASK_EXTERNAL_LEGEND)
  53.  
  54. #undef  SUBTARGET_SWITCHES
  55. #define SUBTARGET_SWITCHES \
  56.     { "standard",             MASK_STANDARD }, \
  57.     { "legend",                 MASK_LEGEND }, \
  58.     { "external-legend",         MASK_EXTERNAL_LEGEND }, \
  59.     /* the following is used only in the *_SPEC's */ \
  60.     { "keep-coff",             0 },
  61.  
  62. /* Default switches */
  63. #undef    TARGET_DEFAULT
  64. #define TARGET_DEFAULT    (MASK_CHECK_ZERO_DIV     | \
  65.              MASK_OCS_DEBUG_INFO     | \
  66.              MASK_OCS_FRAME_POSITION | \
  67.              MASK_STANDARD         | \
  68.              MASK_SVR4)
  69. #undef    CPU_DEFAULT
  70. #define CPU_DEFAULT MASK_88000
  71.  
  72. /* Macros to be automatically defined.  __svr4__ is our extension.
  73.    __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
  74.    files with DG/UX revision 5.40 and later.  This allows GNU CC to
  75.    operate without installing the header files.  */
  76.  
  77. #undef    CPP_PREDEFINES
  78. #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
  79.    -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)"
  80.  
  81. /* If -m88100 is in effect, add -Dm88100; similarly for -m88110.
  82.    Here, the CPU_DEFAULT is assumed to be -m88000.  If not -ansi,
  83.    -traditional, or restricting include files to one specific source
  84.    target, specify full DG/UX features.  */
  85. #undef    CPP_SPEC
  86. #define    CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \
  87.           %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \
  88.           %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}} \
  89.           %{msvr3:-D_M88KBCS_TARGET} %{!msvr3:-D_DGUX_TARGET}"
  90.  
  91. /* Assembler support (-V, silicon filter, legends for mxdb).  */
  92. #undef    ASM_SPEC
  93. #define ASM_SPEC "\
  94. %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\
  95. %{!msvr3:%{!m88110:-KV3 }%{m88110:-KV04.00 }}}\
  96. %{!mlegend:%{mstandard:-Wc,off}}\
  97. %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\
  98. %{traditional:,-lc}%{!traditional:,-lansi-c}\
  99. %{mstandard:,-keep-std}\
  100. %{mkeep-coff:,-keep-coff}\
  101. %{mexternal-legend:,-external}\
  102. %{mocs-frame-position:,-ocs}}"
  103.  
  104. /* Override svr4.h.  */
  105. #undef    ASM_FINAL_SPEC
  106. #undef    STARTFILE_SPEC
  107.  
  108. /* Linker and library spec's.
  109.    -msvr4 is the default if -msvr3 is not specified.
  110.    -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
  111.    -svr4 instructs gcc to place /usr/lib/values-X[cat].o on the link line.
  112.    -msvr3 indicates linking done in a COFF environment and the link
  113.    script is added to the link line.  In all environments, the first
  114.    and last objects are crtbegin.o (or bcscrtbegin.o) and crtend.o.
  115.    When the -G link option is used (-shared and -symbolic) a final
  116.    link is not being done.  */
  117. #undef    LIB_SPEC
  118. #define LIB_SPEC "%{!msvr3:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}} crtend.o%s"
  119. #undef    LINK_SPEC
  120. #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \
  121.            %{static:-dn -Bstatic} \
  122.            %{shared:-G -dy} \
  123.            %{symbolic:-Bsymbolic -G -dy} \
  124.            %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
  125. #undef    STARTFILE_SPEC
  126. #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \
  127.              %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \
  128.              %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \
  129.              %{!msvr3:crtbegin.o%s} \
  130.              %{svr4:%{ansi:/lib/values-Xc.o} \
  131.               %{!ansi:%{traditional:/lib/values-Xt.o} \
  132.                %{!traditional:/usr/lib/values-Xa.o}}}}}"
  133.  
  134. #undef    GPLUSPLUS_INCLUDE_DIR
  135. #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include"
  136.  
  137. /* Fast DG/UX version of profiler that does not require lots of
  138.    registers to be stored.  */
  139. #undef    FUNCTION_PROFILER
  140. #define FUNCTION_PROFILER(FILE, LABELNO) \
  141.   output_function_profiler (FILE, LABELNO, "gcc.mcount", 0)
  142.  
  143. /* Output the legend info for mxdb when debugging except if standard
  144.    debugging information only is explicitly requested.  */
  145. #undef  ASM_FIRST_LINE
  146. #define ASM_FIRST_LINE(FILE)                        \
  147.   do {                                    \
  148.     if (TARGET_SVR4)                            \
  149.       {                                    \
  150.     if (TARGET_88110)                        \
  151.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00");   \
  152.     else                                \
  153.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00");   \
  154.       }                                    \
  155.     if (write_symbols != NO_DEBUG                    \
  156.     && ! (TARGET_STANDARD && ! TARGET_LEGEND))            \
  157.       {                                    \
  158.     fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"",    \
  159.          VERSION_STRING, main_input_filename);            \
  160.     fputs (flag_traditional ? " -lc" : " -lansi-c", FILE);        \
  161.     if (TARGET_STANDARD)                        \
  162.       fputs (" -keep-std", FILE);                    \
  163.     if (TARGET_EXTERNAL_LEGEND)                    \
  164.       fputs (" -external", FILE);                    \
  165.     if (TARGET_OCS_FRAME_POSITION)                    \
  166.       fputs (" -ocs", FILE);                    \
  167.     fputc ('\n', FILE);                        \
  168.       }                                    \
  169.   } while (0)
  170.  
  171. /* Override svr4.h.  */
  172. #undef PTRDIFF_TYPE
  173. #undef WCHAR_TYPE
  174. #undef WCHAR_TYPE_SIZE
  175.  
  176. /* Override svr4.h and m88k.h except when compiling crtstuff.c.  These must
  177.    be constant strings when compiling crtstuff.c.  Otherwise, respect the
  178.    -mversion-STRING option used.  */
  179. #undef INIT_SECTION_PREAMBLE
  180. #undef INIT_SECTION_ASM_OP
  181. #undef FINI_SECTION_ASM_OP
  182. #undef CTORS_SECTION_ASM_OP
  183. #undef DTORS_SECTION_ASM_OP
  184.  
  185. #if !defined (CRT_BEGIN) && !defined (CRT_END)
  186. #undef    INIT_SECTION_ASM_OP
  187. #define INIT_SECTION_ASM_OP (TARGET_SVR4            \
  188.                  ? "section\t .init,\"xa\""        \
  189.                  : "section\t .init,\"x\"")
  190. #undef    CTORS_SECTION_ASM_OP
  191. #define CTORS_SECTION_ASM_OP (TARGET_SVR4            \
  192.                   ? "section\t .ctors,\"aw\""    \
  193.                   : "section\t .ctors,\"d\"")
  194. #undef    DTORS_SECTION_ASM_OP
  195. #define DTORS_SECTION_ASM_OP (TARGET_SVR4            \
  196.                   ? "section\t .dtors,\"aw\""    \
  197.                   : "section\t .dtors,\"d\"")
  198. #else
  199. /* These must be constant strings for crtstuff.c.  
  200.    An elf and bcs crtbegin.o are needed since bcs does not  
  201.    increment the stack pointer in the init section as elf does */
  202. #ifndef BCS
  203. #define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20")  
  204. #endif
  205. #define INIT_SECTION_ASM_OP    "section\t .init,\"x\""
  206. #define FINI_SECTION_ASM_OP    "section\t .fini,\"x\""
  207. #define CTORS_SECTION_ASM_OP    "section\t .ctors,\"d\""
  208. #define DTORS_SECTION_ASM_OP    "section\t .dtors,\"d\""
  209. #endif /* crtstuff.c */
  210.  
  211. /* The lists of global object constructors and global destructors are always
  212.    placed in the .ctors/.dtors sections.  This requires the use of a link
  213.    script if the COFF linker is used, but otherwise COFF and ELF objects
  214.    can be intermixed.  A COFF object will pad the section to 16 bytes with
  215.    zeros; and ELF object will not contain padding.  We deal with this by
  216.    putting a -1 marker at the begin and end of the list and ignoring zero
  217.    entries.  */
  218.  
  219. /* Mark the end of the .ctors/.dtors sections with a -1.  */
  220. #define CTOR_LIST_END            \
  221. asm (CTORS_SECTION_ASM_OP);        \
  222. func_ptr __CTOR_END__[1] = { (func_ptr) (-1) }
  223.  
  224. #define DTOR_LIST_END            \
  225. asm (DTORS_SECTION_ASM_OP);        \
  226. func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
  227.  
  228. /* Walk the list ignoring NULL entries till we hit the terminating -1.  */
  229. #define DO_GLOBAL_CTORS_BODY                \
  230.   do {                            \
  231.     int i;                        \
  232.     for (i=1;(int)(__CTOR_LIST__[i]) != -1; i++)    \
  233.       if (((int *)__CTOR_LIST__)[i] != 0)        \
  234.     __CTOR_LIST__[i] ();                \
  235.   } while (0)                    
  236.  
  237. /* Walk the list looking for the terminating -1 that marks the end.
  238.    Go backward and ignore any NULL entries.  */
  239. #define DO_GLOBAL_DTORS_BODY                \
  240.   do {                            \
  241.     int i;                        \
  242.     for (i=1;(int)(__DTOR_LIST__[i]) != -1; i++);    \
  243.     for (i-=1;(int)(__DTOR_LIST__[i]) != -1; i--)    \
  244.       if (((int *)__DTOR_LIST__)[i] != 0)        \
  245.     __DTOR_LIST__[i] ();                \
  246.   } while (0)                    
  247.